import {get,update,remove} from './crud'

export function getByModelID(mid,spec){
    if(spec == "" || spec == undefined || spec == null){
        return get("tmodelprotocol", mid)
    }else{
        return get("tmodelprotocol", mid + "?spec" + spec)
    }
    
}

export function saveProtocol(protocol){
    return update('tmodelprotocol',protocol)
}
export function removeAllProtocol(mid){
    return remove('tmodelprotocol',mid)
}
export function removeProtocol(mid,protocolpath){
    return remove('tmodelprotocol',mid + '?path=' + protocolpath)
}

export default{
    getByModelID,
    saveProtocol,
    removeAllProtocol,
    removeProtocol,
}